/*
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package net.javlov.vf;

import net.javlov.State;

public interface StateTrace {

	/**
	 * Parameters passed here are the state to which the trace applies, and the value
	 * of that state.
	 * 
	 * @param s
	 * @param val
	 */
	public void firstVisit(State s, Value val);
	
	/**
	 * Called when the state for this trace is visited again before its trace falls
	 * below threshold.
	 */
	public void visit();
	
	/**
	 * The state passed in as parameter is the last state the agent is updating, *not*
	 * the state of this trace.
	 * 
	 * @param s
	 */
	public void update(State s);
	
	/**
	 * 
	 * @return the current trace value
	 */
	public double getTrace();
	
	/**
	 * 
	 * @return a pointer to the value of this trace's state 
	 */
	public Value getValue();
	
	/**
	 * 
	 * @return a new trace instance
	 */
	public StateTrace newInstance();
}
